package com.itheima.demo01;

import java.lang.reflect.Method;

public class Demo01 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException {
        Class clazz = Class.forName("com.itheima.demo01.Student");
        Method[] methods = clazz.getMethods();
        for (Method method : methods) {
            System.out.println(method);
        }
        System.out.println("----------------------------------------------------");
        Method getStuId = clazz.getMethod("getStuId");
        System.out.println(getStuId);
        System.out.println("----------------------------------------------------");
        Method[] declaredMethods = clazz.getDeclaredMethods();
        for (Method declaredMethod : declaredMethods) {
            System.out.println(declaredMethod);
        }
        System.out.println("----------------------------------------------------");
        Method show = clazz.getDeclaredMethod("show", String.class);
        System.out.println(show);
        System.out.println("----------------------------------------------------");

    }
}
